{% extends "base.html" %}
{% import 'macros.html' as macros -%}
{% block menu %}{% endblock %}
{% block title %} - match command-line arguments to their help text{% endblock %}
{% block head -%}
        <meta name="author" content="Idan Kamara">
        <meta name="description" content="match command-line arguments to their help text">
{%- endblock %}
        {% block header -%}
            <div>write down a command-line to see the help text that matches each argument</div>
            <div style="margin-top: 10px; font-weight: bold">try <a href="http://showthedocs.com">showthedocs</a> for explaining other languages</div>
        {%- endblock %}
            {% block content -%}
            <div class="push"></div>
            <div class="text-center">
                <div class="input-append">
                    <form action='/explain' method="get">
                        <input id='explain' class="span10" type="text" name="cmd" autocapitalize="off" autocorrect="off"></input>
                        <button class="btn" type="submit">EXPLAIN</button>
                    </form>
                </div>
            </div>
            <div class="row">
                <div class="offset1 span10" id="examples">
                    <h3>examples</h3>
                    <div style="padding-bottom: 10px;">(new! command substitution and control flows support)</div>
                    <ul>
                        {{ macros.examplebullet(":(){ :|:& };:") }}
                        {{ macros.examplebullet("for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l 2>/dev/null; done") }}
                        {{ macros.examplebullet('file=$(echo `basename "$file"`)') }}
                        {{ macros.examplebullet("true && { echo success; } || { echo failed; }") }}
                        {{ macros.examplebullet("cut -d ' ' -f 1 /var/log/apache2/access_logs | uniq -c | sort -n") }}
                        {{ macros.examplebullet('tar zcf - some-dir | ssh some-server "cd /; tar xvzf -"') }}
                        {{ macros.examplebullet("tar xzvf archive.tar.gz") }}
                        {{ macros.examplebullet("find . -type f -print0") }}
                        {{ macros.examplebullet("ssh -i keyfile -f -N -L 1234:www.google.com:80 host") }}
                        {{ macros.examplebullet("git log --graph --abbrev-commit --pretty=oneline origin..mybranch") }}
                    </ul>
                </div>
            </div>
            {%- endblock %}
{% block js -%}
        <script type="text/javascript">
            $("#explain").focus();
        </script>
{%- endblock %}
